package com.lsh.streamgd.utils;

/**
 * Author: ljgsonx
 * Date: 2017/4/29 1:18
 */
public enum EnCode {
    UTF8("UTF8",1), GBK("GBK",2),
    UNICODE("Unicode",3),UTF16BE("UTF-16BE",4),
    ANSI("ANSI|ASCII",5);
    public String name;
    public int value;
    EnCode(String name,int value){
        this.name = name;
        this.value = value;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getValue() {
        return value;
    }
    public void setValue(int value) {
        this.value = value;
    }
    public static String getNameByValue(int value){
        switch (value) {
            case 1:
                return UTF8.name;
            case 2:
                return GBK.name;
            case 3:
                return UNICODE.name;
            case 4:
                return UTF16BE.name;
            case 5:
                return ANSI.name;
            default:
                return UTF8.name;
        }
    }
}
